<?php

declare(strict_types=1);

namespace app\model;

use think\Model;
use think\model\concern\SoftDelete;

class RegionUser extends Model
{
    use SoftDelete;

    protected $name = 'region_user';

    protected $autoWriteTimestamp = 'datetime';

    public const ROLE_MANAGER = 'manager';
    public const ROLE_OPERATOR = 'operator';

    public function region()
    {
        return $this->belongsTo(Region::class, 'region_id');
    }

    public function user()
    {
        return $this->belongsTo(User::class, 'user_id');
    }
}
